package scenic;

import java.awt.Rectangle;

import scenic.filter.Filter;
import scenic.geom.Affine2;

/**
 * Scene settings class is used to apply rendering settings to child nodes. 
 * in the scene graph. Currently experimental, does not work.
 */
public class SceneSettings extends SceneContainer {
	private Filter antialiasingFilter;
	
	/**
	 * Constructs a new SceneSettings object.
	 */
	public SceneSettings() {
	}

	/**
	 * Gets the antialiasing filter that is used to antialias polygons and text.
	 * 
	 * @return the antialiasing filter
	 */
	public Filter getAntialiasingFilter() {
		return antialiasingFilter;
	}

	/**
	 * Sets the antialiasing filter that is used to antialias polygons and text.
	 * Settings the filter to null disables antialiasing.
	 * 
	 * @param antialiasingFilter the antialiasing filter
	 */
	public void setAntialiasingFilter(Filter antialiasingFilter) {
		this.antialiasingFilter = antialiasingFilter;
	}
	
	void draw(DrawContext context, Affine2 transform, Rectangle visibleArea) {
		DrawContext newContext = context.clone();
		
		newContext.antialiasingFilter = antialiasingFilter;		
		super.draw(newContext, transform, visibleArea);
	}	
	
	Rectangle getBounds(DrawContext context, Affine2 transform) {
		DrawContext newContext = context.clone();
		
		newContext.antialiasingFilter = antialiasingFilter;
		return super.getBounds(newContext, transform);
	}	
}
